import 'package:kkhousekeep/generated/json/base/json_field.dart';
import 'package:kkhousekeep/generated/json/member_list_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class MemberListEntity {
	late int code;
	late MemberListObj obj;
	late String msg;

	MemberListEntity();

	factory MemberListEntity.fromJson(Map<String, dynamic> json) => $MemberListEntityFromJson(json);

	Map<String, dynamic> toJson() => $MemberListEntityToJson(this);

	MemberListEntity copyWith({int? code, MemberListObj? obj, String? msg}) {
		return MemberListEntity()
			..code= code ?? this.code
			..obj= obj ?? this.obj
			..msg= msg ?? this.msg;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class MemberListObj {
	late List<MemberListObjList> list;

	MemberListObj();

	factory MemberListObj.fromJson(Map<String, dynamic> json) => $MemberListObjFromJson(json);

	Map<String, dynamic> toJson() => $MemberListObjToJson(this);

	MemberListObj copyWith({List<MemberListObjList>? list}) {
		return MemberListObj()
			..list= list ?? this.list;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class MemberListObjList {
	late int id;
	late String name;
	late int sex;
	late String iDCardType;
	late String iDCard;
	late String phone;
	late String image;
	late String relationship;

	MemberListObjList();

	factory MemberListObjList.fromJson(Map<String, dynamic> json) => $MemberListObjListFromJson(json);

	Map<String, dynamic> toJson() => $MemberListObjListToJson(this);

	MemberListObjList copyWith({int? id, String? name, int? sex, String? iDCardType, String? iDCard, String? phone, String? image, String? relationship}) {
		return MemberListObjList()
			..id= id ?? this.id
			..name= name ?? this.name
			..sex= sex ?? this.sex
			..iDCardType= iDCardType ?? this.iDCardType
			..iDCard= iDCard ?? this.iDCard
			..phone= phone ?? this.phone
			..image= image ?? this.image
			..relationship= relationship ?? this.relationship;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}